﻿var getScriptArgs = function() {
    var scripts = document.getElementsByTagName("script"), script = scripts[scripts.length - 1], src = script.src, reg = /(?:\?|&)(.*?)=(.*?)(?=&|$)/g, temp, res = {};
    while ((temp = reg.exec(src)) != null) res[temp[1]] = decodeURIComponent(temp[2]);
    return res;
};
var args = getScriptArgs();
var getScriptArg = function(key) {
    var scripts = document.getElementsByTagName("script"), script = scripts[scripts.length - 1], src = script.src;
    return (src.match(new RegExp("(?:\\?|&)" + key + "=(.*?)(?=&|$)")) || [ "", null ])[1];
};

var title = "还没有企业网站？立即免费下载";
var url = "/MoBan/";
var StyleId = getScriptArg("StyleId");

if (isNotNull(StyleId)) {
    if (StyleId == 2) {
        document.writeln("<a href='" + url + "' id='qianbo' title='" + title + "' target='_blank'>" + title + "</a>");
    }
} else {
    document.writeln("<a href='/' title='返回首页'>&laquo; 返回首页</a>");
    document.writeln("<a href='" + url + "' title='" + title + "' class='about' target='_blank'>" + title + "</a>");
}

function isNotNull(ele) {
    if (typeof ele === "undefined") {
        return false;
    } else if (ele == null) {
        return false;
    } else if (ele == "") {
        return false;
    }
    return true;
}